d3 | 您所在的位置:网站首页 › react 安装d3js › d3 |
d3.tip:d3.js 可视化的工具提示
请参阅API 文档 下载最新版本 开发版本:6kb / ~2kb gzipped 使用 NPM 安装 npm install d3-tip 快速使用 /* Initialize tooltip */tip = d3.tip().attr('class', 'd3-tip').html(function(d) { return d; }); /* Invoke the tip in the context of your visualization */vis.call(tip) vis.selectAll('rect') .data(data) .enter() .append('rect') .attr('width', function() { return x.rangeBand() }) .attr('height', function(d) { return h - y(d) }) .attr('y', function(d) { return y(d) }) .attr('x', function(d, i) { return x(i) }) .on('mouseover', tip.show) .on('mouseout', tip.hide)如果你想要基本的样式,你可以example-styles.css使用像 rawgithub.com 这样的服务。 |
CopyRight 2018-2019 实验室设备网 版权所有 |